/*
 * @Author: Joel
 * @Date: 2025-04-14 08:47:41
 * @LastEditors: Joel
 * @LastEditTime: 2025-04-15 20:45:24
 * @FilePath: /gd32f303cct6/usr/board_driver/oled.h
 * @Description:
 * Copyright (C) 2025 YiJiaLink, All Rights Reserved.
 * 2025-04-14 08:47:41
 */

#ifndef __OLED_H
#define __OLED_H

/* 包含头文件代码 */

#include <stdio.h>
#include <stdint.h>
#include <string.h>

#include "gd32f30x.h"
#include "control.h"

#if defined(__cplusplus)
extern "C"
{
#endif /*_cplusplus*/

enum OLED_SEND
{
    S_COMMAND,
    S_DATA
};
enum OLED_CS
{
    CS_ENABLE,
    CS_DISABLE
};
/* 功能打包 */
struct oled_func
{
    /* data */
    void (*init_oled)(void);
    void (*send_com)(uint8_t *buf, uint16_t len);
    void (*send_data)(uint8_t *buf, uint16_t len);
    void (*clear_oled)(void);
    void (*fill_oled)(void);
    void (*dis_set)(void);
    void (*pictrue)(const unsigned char *ptr_pic);
    void (*stop_oled)(void);
    void (*draw_point)(uint8_t x, uint8_t y);
    void (*draw_line)( unsigned char x1, unsigned char y1, unsigned char x2,unsigned char y2);
    void (*draw_rectangle)(unsigned char x1, unsigned char y1, unsigned char x2, unsigned char y2);
    void (*draw_circle)(unsigned char  x, unsigned char  y, unsigned char  r);
    void (*draw_bmp)(unsigned char x0, unsigned char y0,unsigned char width,unsigned char high,const unsigned char BMP[]);
    void (*draw_clear)(unsigned char x0, unsigned char y0,unsigned char width,unsigned char high, unsigned char color);
};



struct oled_func *oled_driver_init(void);

#if defined(__cplusplus)
}
#endif /*_cplusplus*/

#endif
/* el psy congroo */